package com.mzy.datepackage.M2022.Apr.eleven;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/4/11 15:23
 * @Version 1.0
 */
public class InputOut {
    public static void main(String[] args) throws IOException {
        BufferedInputStream in = new BufferedInputStream( new FileInputStream( "read.txt"));
        ByteArrayOutputStream out = new ByteArrayOutputStream(1024);

        byte[] temp = new byte[1024];
        int size = 0;
        while ((size = in.read(temp)) != -1) {
            out.write(temp, 0, size);
        }
        in.close();

        byte[] content = out.toByteArray();
        System.out.println( "Readed bytes count:" + content.length);
        for (byte item:
             temp) {
            System.out.print(item);
        }
    }
}
